<?php
/**
 * Created by PhpStorm.
 * User: HS032
 * Date: 2020/7/15
 * Time: 9:16
 */

namespace backend\controllers;


use app\models\CommonApp;
use common\libs\Tools;
use Yii;
use yii\web\Controller;

/*** 实例控制器
 * Class InstanceController
 * @package backend\controllers
 */
class InstanceController extends BasicController
{
    /*** 实例列表
     * @return false|string
     */
    public function actionList()
    {

        $get = Yii::$app->request->get();
        $page = isset($get['page'])?(int)$get['page']:1;

        $pageSize = Yii::$app->params['pageSize'];
        if ($pageSize == ''){
            $pageSize = 10;
        }

        $list = CommonApp::find()->offset($pageSize * ($page - 1))->orderBy(['app_id' => SORT_DESC])->asArray()->all();
        return Tools::showRes(0,'success',[
            'list' => $list,
        ]);

    }







}